package com.opticon.vaadinR.core.r;

import com.opticon.vaadinR.interfaces.RResultHandler;
import com.vaadin.Application;

/**
 * This class is a
 */
public class ResultHandlerProvider {
    private HuberRResultHandler iHuberRResultHandler = null;
    private DensityRResultHandler iDensityRResultHandler = null;
    private final Application iApplication;

    public ResultHandlerProvider(Application aApplication) {
        iApplication = aApplication;
    }

    public RResultHandler getRHuberRResultHandler() {
        if(iHuberRResultHandler == null){
            iHuberRResultHandler = new HuberRResultHandler(iApplication);
        }
        return iHuberRResultHandler;
    }

    public RResultHandler getDensityRResultHandler() {
        if(iDensityRResultHandler == null){
            iDensityRResultHandler = new DensityRResultHandler(iApplication);
        }
        return iDensityRResultHandler;
    }
}
